package cn.tangsihai.hrm.client;

import cn.tangsihai.hrm.doc.CourseESDoc;
import cn.tangsihai.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * feign接口
 */
@FeignClient(value = "search-server", fallbackFactory = CourseSearchClientFallbackFactory.class)
@RequestMapping("/course")
public interface CourseSearchClient {
    // 将课程添加到ES中
    @PostMapping("/add")
    AjaxResult addCourseToES(@RequestBody CourseESDoc esDoc);

    // 将课程从ES中删除
    @PostMapping("/delete")
    public AjaxResult deleteCourseFromES(@RequestBody Long id);
}
